/*
 * Created by SharpDevelop.
 * Author: Joey
 * Date: 27/09/2007
 * Time: 21:05
 * 
 * Source is copyright Joey Sabey 2007
 */

using System;
using System.Drawing;
using System.Windows.Forms;

namespace MonoTheism
{
	/// <summary>
	/// Description of FileName_Properties.
	/// </summary>
	public partial class FileName_Properties : Form
	{
		private bool bAcceptChanges = false;
		public bool AcceptChanges
		{
			get{return bAcceptChanges;}
		}
		public string FileName
		{
			get{return this.txtFileName.Text;}
		}
		public FileName_Properties()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
		}
		
		void BtCancelClick(object sender, EventArgs e)
		{
			Close();
		}
		
		void BtOkClick(object sender, EventArgs e)
		{
			try
			{
				foreach(char c in System.IO.Path.GetInvalidFileNameChars())
				{
					foreach(char s in this.txtFileName.Text)
					{
						if(s == c)
							throw new Warning("Illegal character in filename: "+c);	
					}
					
				}
				this.bAcceptChanges = true;
				this.Close();
			}
			catch(Warning warn)
			{
				warn.Show();
			}
		}
	}
}
